// panding(不会触发) resolve(触发 then) reject(触发 catch)
// then(data) catch(error)
const p1 = Promise.resolve().then(()=>{
  return 100
})
console.log('p1', p1) // resolved 触发后续 then 回调


const p2 = Promise.resolve().then(()=>{
  throw new Error('then error')
})
console.log('p2', p2) // rejeced 触发后续 catch 回调

const p3 = Promise.reject('my error').catch(err =>{
  console.error(err)
})
console.log("p3:", p3)